<%--
  Created by IntelliJ IDEA.
  User: 柴龙
  Date: 2020/10/3
  Time: 9:08
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<%
    pageContext.setAttribute("APP_PATH", request.getContextPath());
%>
<script type="text/javascript" src="static/js/jquery.min.js"></script>
<!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
<link
        rel="stylesheet"
        href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css"
        integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u"
        crossorigin="anonymous">

<!-- 可选的 Bootstrap 主题文件（一般不用引入） -->
<link
        rel="stylesheet"
        href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap-theme.min.css"
        integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp"
        crossorigin="anonymous">

<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script
        src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"
        integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa"
        crossorigin="anonymous"></script>
<html>
<head>
    <title>Title</title>
</head>
<body>
<div class="Container">
    <h2>按照种类查询</h2>
    <form method="post" action="search" >
        <input type="radio" name="akd" value="png">png
        <input type="radio" name="akd" value="txt">txt
        <input type="radio" name="akd" value="jpg">jpg
        <input type="radio" name="akd" value="log">log
        <input type="radio" name="akd" value="xml">xml
        <input type="radio" name="akd" value="doc">doc
        <input type="radio" name="akd" value="docx">docx
        <input type="radio" name="akd" value="xls">xls
        <input type="submit" value="查询">
    </form>
        <div class="panel panel-primary">
            <div class="panel-heading">
                <h3 class="panel-title">查询结果</h3>
            </div>
            <div class="panel-body" >
                <table class="table table-hover" style="margin-top:2px;">
                    <thead>
                    <tr>
                        <th>上传人</th>
                        <th>时间</th>
                        <th>文件名</th>
                        <th>下载</th>
                        <th>下载次数</th>
                    </tr>
                    </thead>
                    <tbody>
                    <c:forEach items="${userList}" var="user" varStatus="vs">
                        <tr>
                            <td>${user.creater}</td>
                            <td>${user.createtime}</td>
                            <td>${user.filename}</td>
                            <td><a href="download?filename=${user.filename}&&fixtimes=${user.fixtimes}">下载</a></td>
                            <td>${user.fixtimes}</td>
                        </tr>
                    </c:forEach>
                    </tbody>
                </table>
            </div>
        </div>
        <div style="margin:0px;text-align:center;margin-top:0px;">
            <ul class="pagination" style="height:100px;">
                <li <c:if test="${!page.hasPreviouse}"> class="disabled" </c:if>>
                    <c:if test="${!page.hasPreviouse}">
                        <span> << </span>
                    </c:if>
                    <c:if test="${page.hasPreviouse}">
                        <a href="findpage?start=${page.start-page.count}">
                            <span> << </span>
                        </a>
                    </c:if>
                </li>
                <c:forEach begin="0" end="${page.totalPage-1}" varStatus="status">
                    <c:if test="${status.count*page.count-page.start<=30 && status.count*page.count-page.start>=-10}">
                        <li <c:if test="${status.index*page.count==page.start}">class="disabled"</c:if>>
                            <a href="findpage?start=${status.index*page.count}"
                               <c:if test="${status.index*page.count==page.start}">class="current"</c:if>
                            >${status.count}</a>
                        </li>
                    </c:if>
                </c:forEach>
                <li <c:if test="${!page.hasNext}">class="disabled"</c:if>>
                    <c:if test="${!page.hasNext}">
                        <span> >> </span>
                    </c:if>
                    <c:if test="${page.hasNext}">
                        <a href="findpage?start=${page.start+page.count}">
                            <span> >> </span>
                        </a>
                    </c:if>
                </li>
                <li>总记录  ${page.count} 总页数 ${page.totalPage} 当前第
                    <c:if test="${page.start==0}">1.0</c:if>
                    <c:if test="${page.start!=0}">${(page.start/page.count)+1}</c:if>
                    页
                </li>
                </li>
            </ul>
        </div>
</div>
</body>
</html>
